<?php
// +----------------------------------------------------------------------
// | Author: 黄柯柯 <keke.huang@ostengar.com>
// +----------------------------------------------------------------------
namespace app\user\service;

use app\user\model\UserDislikeModel;
use think\Db;

class UserDislikeService
{

    /**
     * 用户不喜欢文章列表
     * @param     $filter
     * @param int $filter['per_page'] 每页多少条数据 默认10
     * @param int $filter['user_id'] 用户id
     * @return     $result 用户点赞集合
     * @throws \think\exception\DbException
     */
    public function userDislikeArticleList($filter)
    {

        $per_page         = empty($filter['per_page']) ? 10 : $filter['per_page'];
        $userDislikeModel = new UserDislikeModel();
        $result           = $userDislikeModel->with(['article'])->where(['user_id' => $filter['user_id']])->paginate($per_page);
        return $result;
    }

}
